/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 课程列表容器 - 网格布局 */
#courseList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px auto; /* 上下 20px，左右自动居中 */
    width: calc(100% - 40px); /* 左右各减去 20px */
    margin-top: 80px !important;
    max-width: 1200px; /* 限制最大宽度 */
}

/* 课程卡片样式 */
.course-box {
    padding: 20px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e3e9f5;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
}

.course-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(74, 144, 226, 0.1);
}

/* 课程头部信息 */
.course-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.course-title {
    color: #2c3e50;
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 课程详情卡片 */
.detail-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.detail-item {
    text-align: center;
    padding: 0.5rem;
}

.detail-label {
    display: block;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.detail-value {
    display: block;
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* 课程描述 */
.course-description {
    margin: 1rem 0;
}

.description-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 课程页脚 */
.course-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.weeks-info, .toggle-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
}

/* 按钮组样式 */
.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    gap: 8px;
    justify-content: center;
}

.action-btn i {
    font-size: 16px;
}

/* 不同按钮颜色 */
.chapter-btn { background: #2980b9; }
.resource-btn { background: #3498db; }
.preview-btn { background: #5dade2; }
.select-course-btn { background: #2ecc71; }
.drop-course-btn { background: #e74c3c; }
.add-chapter-btn { background: #9b59b6; }
.delete-chapter-btn { background: #e67e22; }
.upload-resource-btn { background: #1abc9c; }

/* 按钮悬停效果 */
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 无内容提示 */
.no-content-message {
    text-align: center;
    color: #7f8c8d;
    padding: 2rem;
    grid-column: 1 / -1;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    #courseList {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    #courseList {
        grid-template-columns: 1fr;
    }
    
    .course-box {
        padding: 15px;
    }
    
    .button-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .course-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .detail-card {
        grid-template-columns: 1fr;
    }
}

#courseList {
    display: grid !important;
    grid-template-columns: repeat(3,1fr) !important;
    gap: 20px !important;
}

/* 修改筛选容器样式为固定定位 */
.filter-container {
    position: fixed;  /* 改为fixed定位 */
    top: 80px;       /* 调整距离顶部的距离，避免与标题栏重叠 */
    left: 20px;
    margin: 0;
    padding: 12px 15px;
    background-color: rgba(255, 255, 255, 0.95); /* 增加透明度 */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    backdrop-filter: blur(5px); /* 添加毛玻璃效果 */
    border: 1px solid rgba(0, 0, 0, 0.1); /* 添加边框 */
}

/* 放大开关和文字 */
.filter-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;  /* 放大文字 */
    gap: 12px;  /* 增加间距 */
}

.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: block;
    width: 52px;
    height: 28px;
    background-color: #e0e0e0;
    border-radius: 28px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    left: 2px;
    top: 2px;
    background-color: white;
    transition: all 0.3s ease;
}

.toggle-input:checked + .toggle-slider {
    background-color: #4CAF50;
}

.toggle-input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    user-select: none;
}

/* 悬停效果 */
.filter-toggle:hover .toggle-slider {
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

/* 聚焦效果 */
.toggle-input:focus-visible + .toggle-slider {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}
/* 图标颜色定义 */
.text-primary { color: #131315; }
.text-teacher { color: #e74a3b; }
.text-time { color: #f6c23e; }
.text-location { color: #1cc88a; }
.text-tutor { color: #36b9cc; }
.text-credits { color: #ff6b6b; }
.text-period { color: #6b66ff; }
.text-assessment { color: #ff9e66; }
.text-objective { color: #5c7cfa; }
.text-week { color: #8e44ad; }
.text-toggle { color: #3498db; }

/* 文本渐变效果 */
.text-gradient {
    background: linear-gradient(90deg, #161717, #1a1e2a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 元信息样式 */
.meta-item {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
}
.meta-text {
    margin-left: 5px;
}

/* 详情项样式 */
.detail-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.detail-item i {
    margin-right: 8px;
    font-size: 1.1em;
}

/* 描述内容样式 */
.description-content {
    margin-top: 8px;
    line-height: 1.6;
}

/* 课程标题样式 */
.course-title {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.course-title i {
    margin-right: 10px;
    font-size: 1.3em;
}

/* 考核方式专用样式 */
.assessment-item {
    display: flex;
    align-items: flex-start;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e0e0e0;
}

.assessment-icon {
    margin-right: 12px;
    font-size: 1.3em;
    padding-top: 2px;
}

.assessment-content {
    flex: 1;
}

.assessment-value {
    margin-top: 6px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    line-height: 1.5;
    color: #5a5c69;
    border-left: 3px solid #4e73df;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .assessment-value {
        padding: 6px 10px;
        font-size: 0.9em;
    }
}

/* 章节容器 */
.chapter-container {
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.chapter-container:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 章节标题部分 */
.chapter-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    min-width: 0; /* 添加这一行，允许内容收缩 */
}

.chapter-badge {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    margin-right: 15px;
    font-size: 0.9em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0; /* 防止徽章被压缩 */
}

.chapter-title {
    margin: 0;
    color: #333;
    font-size: 1.3em;
    font-weight: 600;
}

/* 章节内容部分 */
.chapter-content {
    background: #f9fafc;
    border-radius: 6px;
    padding: 15px;
}

.content-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.content-icon {
    color: #4e73df;
    margin-right: 10px;
    font-size: 1.2em;
}

.content-title {
    margin: 0;
    color: #555;
    font-size: 1.1em;
    font-weight: 500;
}

.content-text {
    line-height: 1.6;
    color: #444;
    padding-left: 10px;
    border-left: 3px solid #e0e6ff;
}

/* 优化筛选容器 */
.filter-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* 优化选择框样式 */
.filter-select {
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    font-size: 14px;
    color: #364152;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.filter-select:hover {
    border-color: #c9d3e0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.filter-select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
}

/* 资源卡片样式 - 更新版 */
.resource-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 18px;
    margin-bottom: 18px;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
}

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #4f46e5, #7c3aed);
}

.resource-header {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
}

.file-icon {
    font-size: 24px;
    min-width: 24px;
    text-align: center;
}

.resource-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.resource-content {
    margin-bottom: 14px;
    padding-left: 8px;
}

.resource-meta {
    font-size: 14px;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resource-footer {
    display: flex;
    justify-content: flex-end;
}

.resource-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.versions-btn {
    background-color: #4f46e5;
    color: white;
}

.versions-btn:hover {
    background-color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

/* 文件类型图标颜色 */
.fa-file-pdf { color: #e74c3c; }
.fa-file-powerpoint { color: #e67e22; }
.fa-file-word { color: #3498db; }
.fa-file-excel { color: #2ecc71; }
.fa-file-audio { color: #9b59b6; }
.fa-file-image { color: #e91e63; }
.fa-file-archive { color: #f39c12; }

.version-item {
    transition: all 0.2s ease;
}

.action-btn {
    transition: all 0.2s ease;
    font-size: 14px;
}

.version-header {
    min-height: 40px;
}

/* 搜索框样式 */
.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
}